package cn.iocoder.yudao.module.cont.dal.mysql.base;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.cont.dal.dataobject.base.BaseInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.cont.controller.admin.base.vo.*;

/**
 * 合同基础信息表  Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface BaseInfoMapper extends BaseMapperX<BaseInfoDO> {

    default PageResult<BaseInfoDO> selectPage(BaseInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BaseInfoDO>()
                .likeIfPresent(BaseInfoDO::getHtid, reqVO.getHtid())
                .likeIfPresent(BaseInfoDO::getHtmc, reqVO.getHtmc())
                .eqIfPresent(BaseInfoDO::getHtlx, reqVO.getHtlx())
                .eqIfPresent(BaseInfoDO::getHtlb, reqVO.getHtlb())
                .geIfPresent(BaseInfoDO::getKssj, reqVO.getKssj())
                .betweenIfPresent(BaseInfoDO::getJssj, reqVO.getJssj())
                .eqIfPresent(BaseInfoDO::getFkfs, reqVO.getFkfs())
                .eqIfPresent(BaseInfoDO::getKhdw, reqVO.getKhdw())
                .likeIfPresent(BaseInfoDO::getKhlxr, reqVO.getKhlxr())
                .eqIfPresent(BaseInfoDO::getHtzt, reqVO.getHtzt())
                .betweenIfPresent(BaseInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BaseInfoDO::getQdsj, reqVO.getQdsj())
                .eqIfPresent(BaseInfoDO::getXid, reqVO.getXid())
                .eqIfPresent(BaseInfoDO::getJrdd, reqVO.getJrdd())
                .eqIfPresent(BaseInfoDO::getScdd, reqVO.getScdd())
                .orderByDesc(BaseInfoDO::getId));
    }

}